/**
 * web服务ip地址
 * @type {string}
 */
var IP_ADDRESS = 'http://172.20.10.4:8080';

/**
 * 已登陆用户信息
 * @type {string}
 */
var user = "";

angular.module('starter', ['ionic', 'starter.controllers'])

  .run(function ($ionicPlatform) {
    $ionicPlatform.ready(function () {
 
      if (window.cordova && window.cordova.plugins.Keyboard) {
        cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
        cordova.plugins.Keyboard.disableScroll(true);

      }
      if (window.StatusBar) {
        
        StatusBar.styleDefault();

      }
    });
  })


  .config(function ($stateProvider, $urlRouterProvider) {
    $stateProvider

      .state('app', {
        url: '/app',
        abstract: true,
        templateUrl: 'templates/menu.html',
        controller: 'AppCtrl'
      })

      .state('app.homepage', {
        url: '/home',
        views: {
          'menuContent': {
            templateUrl: 'templates/states/homepage.html',
            controller: 'HomeCtrl'
          }
        }
      })
      .state('app.about_me', {
        url: '/about_me',
        views: {
          'menuContent': {
            templateUrl: 'templates/states/about_me.html',
            controller: 'MeCtrl'
          }
        }
      })
      .state('app.music', {
        url: '/music',
        views: {
          'menuContent': {
            templateUrl: 'templates/states/music.html'
          }
        }
      })
      .state('app.feeds', {
        url: '/feeds',
        views: {
          'menuContent': {
            templateUrl: 'templates/states/feeds.html',
            controller: 'FeedCtrl'
          }
        }
      })
      .state('app.notification', {
        url: '/notification',
        views: {
          'menuContent': {
            templateUrl: 'templates/states/notification.html',
            controller: 'NotificationCtrl'
          }
        }
      })
      .state('app.photo', {
        url: '/photo',
        views: {
          'menuContent': {
            templateUrl: 'templates/states/photo.html'
          }
        }
      })
      .state('app.logout', {
        url: '/logout',
        views: {
          'menuContent': {
            templateUrl: 'templates/states/login.html',
            controller: 'LoginCtrl'
          }
        }
      })
        .state('app.post', {
          url: '/post',
          views: {
            'menuContent': {
              templateUrl: 'templates/states/Post.html',

            }
          }
        })
        .state('app.introduction', {
          url: '/introduction',
          views: {
            'menuContent': {
              templateUrl: 'templates/states/association.html',

            }
          }
        })
      .state('app.setting', {
      url: '/setting',
      views: {
        'menuContent': {
          templateUrl: 'templates/states/setting.html'
        }
      }
    })
        .state('app.newPost', {
          url: '/newPost',
          views: {
            'menuContent': {
              templateUrl: 'templates/states/newAssociation.html'
            }
          }
        })

 
    $urlRouterProvider.otherwise('/app/logout');
    
  });
